#ifndef WIDGET_H
#define WIDGET_H

#include <QtGui/QWidget>
#include <QtGui>
#include "myButton.h"
#include <debug/debug.h>
#include "dialog.h"
#define PI 3.141592653

class Widget : public QWidget
{
    Q_OBJECT
    
public:
    Widget(QWidget *parent = 0);
    ~Widget();
private:
    //QLabel *TitleLabel;
    QLabel *csLabel;//参数设定区
    QPushButton *putLabel;//输出源式
    QPushButton *getLabel;//接受源式
    QRadioButton *putRadio;
    QRadioButton *getRadio;
    QButtonGroup *grop1;

    QPushButton *VLabel;//额定电压
    QPushButton *ILabel;//额定电流
    QLineEdit *VEdit;
    QLineEdit *IEdit;
    QRadioButton *VRadio;
    QRadioButton *IRadio;
    QButtonGroup *grop2;
    QComboBox *VCom;
    QLabel *workbfbV;//工作百分表
    QLabel *workbfbI;
    QLineEdit *bfbVEdit;
    QLineEdit *bfbIEdit;
    QLabel *rlLabel;//较出容量
    QLineEdit *rlEdit;
    QLabel *ysLabel; //功率因素
    QLineEdit *ysEdit1;
    QLineEdit *ysEdit2;

    QLabel *kjLabel;//快捷较出设定
    QLabel *kj1;
    QLabel *kj2;
    QLabel *kj3;
    QLabel *kj4;
    QLabel *kj5;
    QLabel *kj6;
    QLabel *kj7;
    QLabel *kj8;
    QLineEdit *kjEdit1;
    QLineEdit *kjEdit2;
    QLineEdit *kjEdit3;
    QLineEdit *kjEdit4;
    QLineEdit *kjEdit5;
    QLineEdit *kjEdit6;

    QLabel *TestLabel;//测试结果
    QLabel *Test1;
    QLabel *Test2;
    QLabel *Test3;
    QLabel *Test4;
    QLabel *Test5;
    QLabel *Test6;
    QLabel *Test7;//
    QLabel *Test8;

    QLineEdit *TestEdit1;
    QLineEdit *TestEdit2;
    QLineEdit *TestEdit3;
    QLineEdit *TestEdit4;
    QLineEdit *TestEdit5;
    QLineEdit *TestEdit6;
    QLineEdit *TestEdit7;
    QLineEdit *TestEdit8;

    myButton *button1;
    myButton *button2;

    QLabel *danweiV1;//V
    QLabel *danweiV2;
    QLabel *danweiV3;
    QLabel *danweibfb1;//%
    QLabel *danweibfb2;
    QLabel *danweiI1;//I
    QLabel *danweiI2;
    QLabel *danweiI3;
    QLabel *danweiVA1;//VA
    QLabel *dengyu;//=
    QLabel *du1;
    QLabel *du2;

    QLabel *shuiping1;//水平线
    QLabel *shuiping2;
    QLabel *shuiping3;

    Dialog *theKeyBoard;//数字键盘
    QWidget *widgetInfo;//虚框
    QLabel *labInfo;
private slots:
    void state1(){putRadio->setChecked(true);} //选择输出源式
    void state2(){getRadio->setChecked(true);}  //选择接受源式
    void V_clicked(); //选择额定电压
    void I_clicked(); //选择额定电流

    void stop_clicked();
    void start_clicked();

     void widgetInfoHide(){widgetInfo->hide();}//虚框隐藏

protected:
    virtual bool eventFilter(QObject *watched, QEvent *e);
};

#endif // WIDGET_H
